//
//  UIView+Helper.h
//  智能备考学习
//
//  Created by 盛超 on 2018/8/15.
//  Copyright © 2018年 盛超. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIView (Helper)

/** 获取当前View的控制器对象 */
-(UIViewController *)getCurrentViewController;

/*初始化*/
+ (instancetype)getInstance;

//尺寸间距位置
@property (assign, nonatomic) CGFloat  top;
@property (assign, nonatomic) CGFloat  bottom;
@property (assign, nonatomic) CGFloat  left;
@property (assign, nonatomic) CGFloat  right;

@property (assign, nonatomic) CGFloat  x;
@property (assign, nonatomic) CGFloat  y;
@property (assign, nonatomic) CGPoint  origin;

@property (assign, nonatomic) CGFloat  centerX;
@property (assign, nonatomic) CGFloat  centerY;

@property (assign, nonatomic) CGFloat  width;
@property (assign, nonatomic) CGFloat  height;
@property (assign, nonatomic) CGSize  size;

#pragma mark - 设置部分圆角
/**
 *  设置部分圆角(绝对布局)
 *
 *  @param corners 需要设置为圆角的角 UIRectCornerTopLeft | UIRectCornerTopRight | UIRectCornerBottomLeft | UIRectCornerBottomRight | UIRectCornerAllCorners
 *  @param radii   需要设置的圆角大小 例如 CGSizeMake(20.0f, 20.0f)
 */
- (void)addRoundedCorners:(UIRectCorner)corners
                withRadii:(CGSize)radii;
/**
 *  设置部分圆角(相对布局)
 *
 *  @param corners 需要设置为圆角的角 UIRectCornerTopLeft | UIRectCornerTopRight | UIRectCornerBottomLeft | UIRectCornerBottomRight | UIRectCornerAllCorners
 *  @param radii   需要设置的圆角大小 例如 CGSizeMake(20.0f, 20.0f)
 *  @param rect    需要设置的圆角view的rect
 */
- (void)addRoundedCorners:(UIRectCorner)corners
                withRadii:(CGSize)radii
                 viewRect:(CGRect)rect;

@end
